home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / object / norm_coord.pro < prev    next >
Text File  |  1997-07-08  |  349b  |  13 lines

  1. FUNCTION NORM_COORD, range
  2.  
  3. ; This function takes a range vector [min, max] as contained
  4. ; in the [XYZ]RANGE property of an object and converts it to
  5. ; a scaling vector (suitable for the [XYZ]COORD_CONV property)
  6. ; that scales the object to fit in the range [0,1].
  7.  
  8. scale = [-range[0]/(range[1]-range[0]), 1/(range[1]-range[0])]
  9.  
  10. RETURN, scale
  11.  
  12. END
  13.